#!/usr/bin/env bash
if [ $# -eq 0 ]; then
    if [[ ! -x src/xy ]]; then
        echo "no build available (src/xy missing)"
        exit 1
    fi
    ARGS="src/xy"
else
    ARGS="$@"
fi

valgrind --tool=memcheck \
         --leak-check=full \
         --trace-children=yes \
         --track-fds=yes \
         ${ARGS}
